import React, {Component} from 'react';
import {Text, TextInput, TouchableOpacity, View, Alert, StyleSheet, AsyncStorage, FlatList, Image} from 'react-native';
import {BasicStyle} from "../../../style/BasicStyle";
import Spinner from 'react-native-loading-spinner-overlay';
import Toast from '@remobile/react-native-toast';
import FetchUtils from './../../utils/FetchUtils';
import utils from './../../utils/utils';

export default class MyEditList extends Component {
    static navigationOptions = ({navigation, screenProps}) => ({
        headerTitle: "修改个人信息",
        headerStyle: {
            backgroundColor: '#F6F6F6',
        },
        headerTitleStyle: {
            alignSelf: 'center',
            fontSize: utils.setSpText(17),
        },
        headerRight: <TouchableOpacity/>
    });

    render() {
        return (
            <View style={[BasicStyle.containerView, styles.containerView]}>
                <View style={styles.listView}>
                    <TouchableOpacity style={styles.listItemView} onPress={() => {
                        let {navigate} = this.props.navigation;
                        navigate('MyEditPassNav');
                    }}>
                        <View style={styles.listItemViewView}>
                            <Text style={[BasicStyle.commonFontText, styles.listItemText]}>更换密码</Text>
                            <Image style={styles.rightPointImg}
                                   source={require('./../../../img/rightpoint.png')}/>
                        </View>
                    </TouchableOpacity>
                    <View style={BasicStyle.commonLineMarginLeft}/>

                    <TouchableOpacity style={styles.listItemView} onPress={() => {
                        let {navigate} = this.props.navigation;
                        navigate('MyEditPicNav');
                    }}>
                        <View style={styles.listItemViewView}>
                            <Text style={[BasicStyle.commonFontText, styles.listItemText]}>更新照片和尺寸</Text>
                            <Image style={styles.rightPointImg}
                                   source={require('./../../../img/rightpoint.png')}/>
                        </View>
                    </TouchableOpacity>
                    <View style={BasicStyle.commonLineMarginLeft}/>

                    <TouchableOpacity style={styles.listItemView} onPress={() => {
                        let {navigate} = this.props.navigation;
                        navigate('MyEditStyleNav');
                    }}>
                        <View style={styles.listItemViewView}>
                            <Text style={[BasicStyle.commonFontText, styles.listItemText]}>修改风格信息</Text>
                            <Image style={styles.rightPointImg}
                                   source={require('./../../../img/rightpoint.png')}/>
                        </View>
                    </TouchableOpacity>
                    <View style={BasicStyle.commonLineMarginLeft}/>

                </View>

            </View>
        )
    }
}

const styles = StyleSheet.create({
    containerView: {
        justifyContent: 'space-between'
    },
    listView: {
        marginTop: utils.autoheight(33.5),
        backgroundColor: '#FFF',
    },
    listItemView: {
        height: utils.autoheight(44),
        justifyContent: 'center',
    },
    listItemViewView: {
        flexDirection: 'row',
        justifyContent: 'space-between',
        alignItems: 'center'
    },
    listItemText: {
        marginLeft: utils.autoWidth(16),
    },
    rightPointImg: {
        marginRight: utils.autoWidth(16),
        width: utils.autoWidth(8),
        height: utils.autoheight(13),
        alignItems: 'center',
        justifyContent: 'center',
    },
    exitButStyle: {
        borderWidth: utils.autoheight(1),
        borderColor: '#F6F6F6',
        height: utils.autoheight(44),
        width: utils.screenWidth,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#ECECEC',
    },
});